﻿
@{
    Layout = null;
}
@using FwProject.Core.Distribution
@using FwProject.Distribution.Dto
@using FwProject.Core.Distribution
@using FwProject.Authorization
@model Tuple<DistributionDetailsView, List<DistributionDetailsDto>>
@{ 
    int SumDistributioncount = 0;
    int SumRecoverycount = 0;
    int SumExchangegoodscount = 0;
    int SumDamagecount = 0;
    int SumGivecount = 0;
    int SumBackboxcount = 0;
    int SumBacknumbercount = 0;
    decimal SumPrice = 0;
}
<html>
<head>

    <title>打印</title>
    <link type="text/css" href="/framework/styles/print.css" rel="stylesheet" />
    <script type="text/javascript" src="/framework/scripts/common/print.js"></script>
    <link href="/css/print.css" rel="stylesheet" />
    <style>

    </style>
</head>
<body>
    <OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0 style="display: none"></OBJECT>
    <div align="center"><input type=button value="打印" class="noprint" onClick="window.print()"> <input type=button class="noprint" value="打印预览" onclick="document.all.WebBrowser.ExecWB(7,1)"></div>
    <form name="printformName" id="printformName" action="" method="post">
        <div align="center">
            <div id="printObj" style="width: 190mm" align="center">
                <style>
                    table {
                        border-collapse: collapse;
                        border-spacing: 0px;
                    }
                </style>
                <div align="center" style="font-size: 14px; margin-top: 3px; margin-bottom: 15px; font-weight: bold;">
                    @*百家消毒餐具<br />*@
                    配送单
                </div>

                <table width="100%" cellspacing="0" cellpadding="0" align="center" border="0">
                    <tr>
                        <td width="10%"><b>单号</b>:</td>
                        <td>&nbsp;@Model.Item1.CreationNumber</td>
                        <td width="10%"><b>配送日期</b>:</td>
                        <td>&nbsp;@Model.Item1.CreationTime.ToString("yyyy-MM-dd HH:mm:ss")</td>
                        <td width="10%" style="display: none;"><b>线路</b>:</td>
                        <td style="display: none;">&nbsp;00E29线</td>
                    </tr>
                    <tr>
                        <td><b>餐厅</b>:</td>
                        <td>&nbsp;@Model.Item1.RestaurantName</td>
                        <td><b>司机</b>:</td>
                        <td>@Model.Item1.Name</td>
                        @*<td><b>联系人</b>:</td>
                            <td>&nbsp;</td>
                            <td><b>联系电话</b>:</td>
                            <td>&nbsp;</td>*@
                    </tr>
                    <tr style="display: none;">
                        <td><b>司机</b>:</td>
                        <td>&nbsp;张桂清</td>
                        <td><b>出库仓库</b>:</td>
                        <td>&nbsp;产品仓</td>
                        <td><b>回收仓库</b>:</td>
                        <td>&nbsp;回收仓</td>
                    </tr>
                    <tr>
                        <td><b>应收金额</b>:</td>
                        <td>&nbsp;@Model.Item1.TotalPrice</td>
                        <td style="display: none;"><b>已收金额</b>:</td>
                        <td style="display: none;">&nbsp;0.0</td>
                        <td style="display: none;"><b>本次收款金额</b>:</td>
                        <td style="display: none;">&nbsp;0.0</td>
                        <td style="display: none;"><b>备注</b>:</td>
                        <td colspan="3" valign="top" style="display: none;">&nbsp;</td>
                    </tr>
                    <tr style="display: none;">
                        <td><b>账户</b>:</td>
                        <td>&nbsp;</td>
                        <td><b>备注</b>:</td>
                        <td colspan="3" valign="top">&nbsp;</td>
                    </tr>
                </table>
                <table width="100%" cellspacing="0" cellpadding="0" align="center" border=1 borderColor="black">
                    <tr>
                        <td width="20%" align="center"><b>货品</b></td>
                        <td width="8%" align="center"><b>本次配送箱数</b></td>
                        <td width="8%" align="center"><b>回收箱数</b></td>
                        <td width="8%" align="center"><b>换货箱数</b></td>
                        <td width="8%" align="center"><b>折损套数</b></td>
                        <td width="8%" align="center"><b>赠送箱数</b></td>
                        <td width="8%" align="center"><b>退回箱数</b></td>
                        <td width="8%" align="center"><b>退回套数</b></td>
                        <td width="8%" align="center"><b>状态</b></td>
                        <td width="8%" align="center"><b>单价(元)</b></td>
                        <td width="8%" align="center"><b>应支付金额(元)</b></td>
                    </tr>
                    @foreach (var item in Model.Item2)
                    {
                        <tr>
                            <td align="left">&nbsp;@item.TypeNumberName</td>
                            <td align="right">&nbsp;@item.Distributioncount&nbsp;</td>
                            <td align="right">&nbsp;@item.Recoverycount&nbsp;</td>
                            <td align="right">&nbsp;@item.Exchangegoodscount&nbsp;</td>
                            <td align="right">&nbsp;@item.Damagecount&nbsp;</td>
                            <td align="right">&nbsp;@item.Givecount&nbsp;</td>
                            <td align="right">&nbsp;@item.Backboxcount&nbsp;</td>
                            <td align="right">&nbsp;@item.Backnumbercount&nbsp;</td>
                            <td align="right">&nbsp;@item.Pricestatus&nbsp;</td>
                            <td align="right">&nbsp;@item.TypeNumberPrice&nbsp;</td>
                            <td align="right">&nbsp;@item.Sumprice&nbsp;</td>
                        </tr>
                        SumDistributioncount += item.Distributioncount;
                        SumRecoverycount += item.Recoverycount;
                        SumExchangegoodscount += item.Exchangegoodscount;
                        SumDamagecount += item.Damagecount;
                        SumGivecount += item.Givecount;
                        SumBackboxcount += item.Backboxcount;
                        SumBacknumbercount += item.Backnumbercount;
                        SumPrice += item.Sumprice;
                    }
                        <tr>
                            <td align="center">&nbsp;<b>合计</b>&nbsp;</td>
                            <td align="right">&nbsp;@SumDistributioncount</td>
                            <td align="right">&nbsp;@SumRecoverycount&nbsp;</td>
                            <td align="right">&nbsp;@SumExchangegoodscount&nbsp;</td>
                            <td align="right">&nbsp;@SumDamagecount&nbsp;</td>
                            <td align="right">&nbsp;@SumGivecount&nbsp;</td>
                            <td align="right">&nbsp;@SumBackboxcount&nbsp;</td>
                            <td align="right">&nbsp;@SumBacknumbercount&nbsp;</td>
                            <td></td>
                            <td></td>
                            <td align="right">&nbsp;@SumPrice&nbsp;</td>
                        </tr>
                </table>
                <hr />
                <table style='display:;' width="100%" cellspacing="0" cellpadding="0" align="center" border=0>
                    <tr>
                        <td width="25%" align="left"><b>[制单]</b>&nbsp;@ViewBag.UserName&nbsp;@Model.Item1.CreationTime.ToString("yyyy-MM-dd")</td>
                        <td width="50%" align="center" style="display: none;"><b>[审核]</b>&nbsp;&nbsp;</td>
                        <td width="25%" align="left">客户签字</td>
                        <td width="25%" align="left">送货员签字</td>
                        <td width="25%" align="left">仓库签字</td>

                    </tr>
                </table>

            </div>
        </div>
    </form>

</body>

</html>
